<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加比赛</title>
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-datetimepicker.min.css" />
</head>
<body>
<div>
    <div class="btn-group col-md-6 btn-group-justified " role="group">
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-default" onclick="javascript:location.href='{:U(\'Match/index\')}'">添加比赛</button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-default" onclick="javascript:location.href='{:U(\'Team/index\')}'">添加队伍</button>
        </div>
        <div class="btn-group" role="group">
            <button type="button" class="btn btn-primary" onclick="javascript:location.href='{:U(\'Userinfo/index\')}'">添加队员</button>
        </div>
    </div>
        <form class="form-horizontal" method="post" id="tt" autocomplete="on">
                <div class="form-group col-md-12" style="margin-top: 50px;">
                    <label class="col-md-2 control-label">用户id：</label>
                    <div class="col-md-4">
                        <input type="text" class="form-control" id="user_id" name="user_id">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">队伍id：</label>
                    <div class="col-md-4">
                        <select type="text" class="form-control" id="team_id" name="team_id">
                            <volist name="team" id="t">
                            <option value="{$t.id}">({$t.mname}){$t.name}</option>
                            </volist>
                        </select>
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">评分：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="score" name="score">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">击杀：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="kill" name="kill">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">助攻：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="assists" name="assists">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">死亡：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="death" name="death">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">金钱：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="money" name="money">
                    </div>
                </div>
                <div class="form-group col-md-12">
                    <label class="col-md-2 control-label">杀兵&野怪：</label>
                    <div class="col-md-4">
                        <input type="number" class="form-control" id="kill_soldier" name="kill_soldier">
                    </div>
                </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">输出：</label>
                <div class="col-md-4">
                    <input type="number" class="form-control" id="hurt" name="hurt">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">被输出：</label>
                <div class="col-md-4">
                    <input type="number" class="form-control" id="be_hurt" name="be_hurt">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">插眼：</label>
                <div class="col-md-4">
                    <input type="number" class="form-control" id="insert_eye" name="insert_eye">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">反眼：</label>
                <div class="col-md-4">
                    <input type="number" class="form-control" id="hit_eye" name="hit_eye">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">位置：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" id="position" name="position">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">判定局：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" id="determine" name="determine">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">参团率：</label>
                <div class="col-md-4">
                    <input type="number" class="form-control" id="group_rate" name="group_rate">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-2 control-label">荣誉：</label>
                <div class="col-md-4">
                    <input type="number" class="form-control" id="honor" name="honor">
                </div>
            </div>
            <div class="form-group col-md-12">
                <label class="col-md-4 control-label"></label>
                <div class="col-md-8">
                    <button type="button" class="btn btn-primary" id="tijiao">保存</button>
                </div>
            </div>
        </form>
</div>
</body>
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script src="__PUBLIC__/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/js/bootstrap-datetimepicker.min.js" type="text/javascript" charset="utf-8"></script>
<script src="__PUBLIC__/js/bootstrap-datetimepicker.zh-CN.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(".date-picker").datetimepicker({
        language: 'zh-CN',
    });
    $("#tijiao").on('click',function(){
        var form = $("#tt");
        $.ajax({
            url:form.attr("action"),
            type:'post',
            data:form.serialize(),
            dataType: 'json',
            success:function(data){
                alert(data.info);
               location.reload();
            }
        })
    })
</script>
</html>